/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Client;

import java.net.Socket;

/**
 * 
 * @author TienNT
 */
public class Conversasion extends javax.swing.JFrame {
	Socket mSocket;

	/**
	 * Creates new form Conversasion
	 */
	public Conversasion() {
		initComponents();
		
	}

	public void setSocket(Socket socket) {
		mSocket = socket;
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed"
	// desc="Generated Code">//GEN-BEGIN:initComponents
	private void initComponents() {

		jScrollPane1 = new javax.swing.JScrollPane();
		txtConversasion = new javax.swing.JTextArea();
		jScrollPane2 = new javax.swing.JScrollPane();
		txtMessage = new javax.swing.JTextArea();
		btnSend = new javax.swing.JButton();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

		txtConversasion.setEditable(false);
		txtConversasion.setColumns(20);
		txtConversasion.setRows(5);
		jScrollPane1.setViewportView(txtConversasion);

		txtMessage.setColumns(20);
		txtMessage.setRows(2);
		txtMessage.addKeyListener(new java.awt.event.KeyAdapter() {
			public void keyTyped(java.awt.event.KeyEvent evt) {
				txtMessageKeyTyped(evt);
			}
		});
		
		jScrollPane2.setViewportView(txtMessage);

		btnSend.setText("Send");
		btnSend.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnSendActionPerformed(evt);
			}
		});

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addComponent(jScrollPane1)
												.addGroup(
														layout.createSequentialGroup()
																.addComponent(
																		jScrollPane2,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		342,
																		javax.swing.GroupLayout.PREFERRED_SIZE)
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																.addComponent(
																		btnSend,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		73,
																		Short.MAX_VALUE)))
								.addContainerGap()));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addComponent(jScrollPane1,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										232,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING,
												false)
												.addComponent(
														jScrollPane2,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														62, Short.MAX_VALUE)
												.addComponent(
														btnSend,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														Short.MAX_VALUE))
								.addContainerGap(
										javax.swing.GroupLayout.DEFAULT_SIZE,
										Short.MAX_VALUE)));

		
		pack();
		txtMessage.requestFocus();
	}// </editor-fold>//GEN-END:initComponents

	private void btnSendActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnSendActionPerformed
		// TODO add your handling code here:
	}// GEN-LAST:event_btnSendActionPerformed

	private void txtMessageKeyTyped(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_txtMessageKeyTyped
		// TODO add your handling code here:
	}// GEN-LAST:event_txtMessageKeyTyped

	// Variables declaration - do not modify//GEN-BEGIN:variables
	private javax.swing.JButton btnSend;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JScrollPane jScrollPane2;
	private javax.swing.JTextArea txtConversasion;
	private javax.swing.JTextArea txtMessage;
	// End of variables declaration//GEN-END:variables
}
